import App from './App'  // 移动到顶部，确保只导入一次

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 配置 Vue 2 环境
Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
  ...App
})

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 配置 Vue 3 环境
export function createApp() {
  const app = createSSRApp(App)

app.use(ElementPlus, {
  locale: zhCn,
})

  return { app }
}
// #endif
